<template>
  <el-dialog v-el-drag-dialog width="40%" title="查看图片" v-if="showDialog" :visible.sync="showDialog" append-to-body>
    <div style="text-align: center;">
      <img class="img" :src="imgurl" alt="" />
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: 'showImage',
  props: {
    imgurl: {
      type: String,
      default: ''
    },
  },
  data () {
    return {
      showDialog: false
    }
  },
  methods: {
    close () {
      this.showDialog = false
    },
    open () {
      this.showDialog = true
    }
  }
}
</script>

<style lang="scss" scoped>
.img {
  max-width: 100%;
}
</style>